#pragma once
namespace ne{
class GameObjectManager;
class InputSystem;
class State;
class LuaEngine;
class PhysicsWorld;
class StateListener {
public:
	StateListener(){}
	~StateListener(){}
	virtual State* FindByName(const Ogre::String& name) = 0;
	virtual void ChangeState(State* state) = 0;
	virtual void AddState(State* state) = 0;
};

class PhysicsWorld;
class State {
public:
	State(const Ogre::String& name,const Ogre::String& className,Ogre::RenderWindow* renderWindow,InputSystem* inputSystem,LuaEngine* luaEngine, PhysicsWorld* physicsWorld);
	~State(void);

	void Enter();
	bool Update(class GameTime* gameTime);
	void Exit();

	const Ogre::String& GetName()const{return m_name;}
	const Ogre::String& GetFilename()const{return m_className;}

private:
	void Restart();
	GameObjectManager*				m_gameObjectManager;
	InputSystem*					m_inputSystem;
	Ogre::RenderWindow*				m_renderWindow;
	LuaEngine*						m_luaEngine;
	PhysicsWorld*					m_physicsWorld;
	Ogre::SceneManager*				m_sceneManager;
	std::vector<Ogre::Viewport*>	m_viewports;
	Ogre::String					m_name;
	Ogre::String					m_className;
};
}